import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-11-03
 * Time: 21:03
 */
public class test_1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            long ret = in.nextLong();
            for (int i = 0; i < n; i++) {
                long tmp = in.nextLong();
                if (tmp > ret) {
                    ret += gcd(ret, tmp);
                } else {
                    ret += tmp;
                }
            }
            System.out.println(ret);
        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }
}
